do { os::println 'Hello World' }
    . { then { os::println { "[OS Info] system=?, arch=? (?)"
        let { system, arch, is-64-bit } := os::PlatformInfo,
        (system, arch, (if is-64-bit: '64-bit', else: '32-bit')) } } }
    . { then { os::println 'timer' } }
    . { then { wait { timeout: 2000 } } }
    . { then { os::println { String { exp { log { Complex (5.0, 5.0) } } } } } }
    . { then { os::println (2.0 * { Complex (0.0, 1.0) }).{sqrt}.{asin}.{sin}.{String} } }
    . { then { os::println (2.0 * { Complex (0.0, 1.0) }).{sqrt}.{acos}.{cos}.{String} } }
    . { then { os::println (2.0 * { Complex (0.0, 1.0) }).{sqrt}.{atan}.{tan}.{String} } }
    . { then { os::println { String (20.[Integer] ** 11) } } }
    . { then { os::println { String { factorial 20 } } } }
    . { then { os::println 'merge (0..5)' } }
    . { then { yield* { Seq { from: 0, to: 5 } } }
                . [Observable[Number,Error]]
                . { merge-map &(i) => { os::println { String i } } }
                . { wait-complete } }
    . { then { os::println 'ticker' } }
    . { then { tick { interval: 1000 } }
                . { scan        (0.[Number], &(n, _) => (1 + n)) }
                . [Observable[Number,Error]]
                . { concat-map  &(n) => { os::println { String n } } }
                . { wait-complete } }  // TODO: cancel
    . { crash-on-error };

function factorial:
    &(Integer) => Integer
    &(n) =>
        if (n <= 1):
            1,
        else:
            (n * { factorial (n - 1) });
